<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>绩效考核系统</title>
<link href="styles/core.css" rel="stylesheet" type="text/css">
<link href="styles/Master.css" rel="stylesheet" type="text/css">

<script type="text/javascript" src="scripts/jquery/jquery.js"></script>
<script type="text/javascript" src="scripts/common.js"></script>
<script type="text/javascript" src="scripts/message.js"></script>

<script type="text/javascript" src="scripts/system/database.js"></script>

<style>

</style>

<script>

</script>

</head>

<body>
<s:form name="databaseForm" id="databaseForm" action="database-operate" namespace="/system" method="post">

	<s:hidden name="importFile" id="importFile"></s:hidden>
	<s:hidden name="pagerEntity.pageInfo.pageNow" id="pageNow"></s:hidden>
	<h2 style="text-align: left">数据备份与还原</h2>
	<hr width="100%" align="left" size="1" color="#E1EEF8">

	<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tabHeader" id="dataInfo">
		<thead>
			<tr align="center" class="tdBg">
				<td style="text-align: center" nowrap="nowrap" width="10%">选择</td>
				<td style="text-align: center" nowrap="nowrap" width="90%">文件名</td>
			</tr>
		</thead>
		<tbody>
			<s:if test="#request.pagerEntity.resultList.size==0">
		   		<tr>
		   			<td colspan="2" align="center">
		   				对不起！没有搜索到结果......
		   			</td>
		   		</tr>
		   	</s:if>
		   	<s:else>

				<s:set id="total" value="0"></s:set>
			    <s:set id="totalSum" value="0"></s:set>

				<s:iterator value="pagerEntity.resultList" id="fileName" status="stat">
					<tr>
						<td style="text-align: center;">
							<s:if test="importFile == #fileName">
								<input type="radio" name="radio_worker" checked="checked" onclick="$('#importFile').val('<s:property value="#fileName"/>');"/>
							</s:if>
							<s:else>
								<input type="radio" name="radio_worker" onclick="$('#importFile').val('<s:property value="#fileName"/>');"/>
							</s:else>
						</td>
						<td>
							<s:property value="#fileName"/>
						</td>
					</tr>
				</s:iterator>
				<tr class="tdBg">
					<td colspan="2" align="right">
						<s:include value="/pages/pagefooter.jsp"></s:include>
					</td>
				</tr>
			</s:else>
		</tbody>
	</table>

	<center>
		<div style="padding: 4px 0pt;">
			<input type="button" value="备份" class="btn_mouseout" onclick="doExport();"
				onmouseover="this.className='btn_mouseover'" onmouseout="this.className='btn_mouseout'"
				onmousedown="this.className='btn_mousedown'" onmouseup="this.className='btn_mouseup'">
			<input type="button" value="还原" class="btn_mouseout" onclick="doImport();"
				onmouseover="this.className='btn_mouseover'" onmouseout="this.className='btn_mouseout'"
				onmousedown="this.className='btn_mousedown'" onmouseup="this.className='btn_mouseup'">
			<input type="button" value="下载" class="btn_mouseout" onclick="doDownload();"
				onmouseover="this.className='btn_mouseover'" onmouseout="this.className='btn_mouseout'"
				onmousedown="this.className='btn_mousedown'" onmouseup="this.className='btn_mouseup'">
		</div>
	</center>
</s:form>

<div id="waiting" style="display: none;">
	<div id="background" class="background"></div>
	<div id="progressBar" class="progressBar">数据加载中，请稍等...</div>
</div>

<form name="downloadFrm" id="downloadFrm" action="system/database-doDownload.action" method="post" target="downloadiFrame">
<input type="hidden" name="importFile" id="importFile">
</form>
<iframe name="downloadiFrame" id="downloadiFrame" src="" style="display:none;visibility:hidden;height:0px;"/>
</body>
</html>